<?php
/**
 * 微博视频插件
 * 
 * Created		: 2011-07-06
 * Modified		: 2011-07-06 
 * @link		: http://qixbo.com
 * @copyright	: (C) 2011 Qixbo Inc.
 * @version		: 0.1.0
 * @author		: Joseph Chen (jsph.chen@gmail.com)
 * @see http://t.qq.com/asyn/validvideo.php?url=http://v.youku.com/v_show/id_XMjQ4OTI2NzA0.html
 */
class MbVideo extends Video
{
	
	protected static $tbl		= 'mb_video';
	protected static $priKey	= 'id';
	
	/**
	 * 执行视频处理
	 * @param array $data
	 */
	public static function execute($data)
	{
		if (!isset($data['video_url'])) {
			return false;
		}
		
		$videoInfo = self::getVideoInfo($data['video_url']);
		
		$data['video'] = json_encode(array(
			'id'		=> $videoInfo['id'],
			'url'		=> $data['video_url'],
			'minipic'	=> $videoInfo['minipic']
		));
		
		unset($data['video_url']);
		
		return $data;
	}
}




